# uncompyle6 version 3.2.3
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.6.8 |Anaconda custom (64-bit)| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: site-packages\asn1crypto\_ffi.py
"""
FFI helper compatibility functions. Exports the following items:

 - LibraryNotFoundError
 - FFIEngineError
 - bytes_from_buffer()
 - buffer_from_bytes()
 - null()
"""
from __future__ import unicode_literals, division, absolute_import, print_function
from ctypes import create_string_buffer


def buffer_from_bytes(initializer):
    return create_string_buffer(initializer)


def bytes_from_buffer(buffer, maxlen=None):
    return buffer.raw


def null():
    pass


class LibraryNotFoundError(Exception):
    """
    An exception when trying to find a shared library
    """

    pass


class FFIEngineError(Exception):
    """
    An exception when trying to instantiate ctypes or cffi
    """

    pass
